Optimal. Leaf size=123 \[ -\frac{\sqrt{b} (3 a-2 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a+b}}\right )}{2 f (a+b)^{7/2}}-\frac{a b \tan (e+f x)}{2 f (a+b)^3 \left (a+b \tan ^2(e+f x)+b\right )}-\frac{\cot ^3(e+f x)}{3 f (a+b)^2}-\frac{(a-b) \cot (e+f x)}{f (a+b)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.174616, antiderivative size = 123, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {4132, 456, 1261, 205} \[ -\frac{\sqrt{b} (3 a-2 b) \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a+b}}\right )}{2 f (a+b)^{7/2}}-\frac{a b \tan (e+f x)}{2 f (a+b)^3 \left (a+b \tan ^2(e+f x)+b\right )}-\frac{\cot ^3(e+f x)}{3 f (a+b)^2}-\frac{(a-b) \cot (e+f x)}{f (a+b)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4132
Rule 456
Rule 1261
Rule 205
Rubi steps
\begin{align*} \int \frac{\csc ^4(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{1+x^2}{x^4 \left (a+b+b x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a b \tan (e+f x)}{2 (a+b)^3 f \left (a+b+b \tan ^2(e+f x)\right )}-\frac{b \operatorname{Subst}\left (\int \frac{-\frac{2}{b (a+b)}-\frac{2 a x^2}{b (a+b)^2}+\frac{a x^4}{(a+b)^3}}{x^4 \left (a+b+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac{a b \tan (e+f x)}{2 (a+b)^3 f \left (a+b+b \tan ^2(e+f x)\right )}-\frac{b \operatorname{Subst}\left (\int \left (-\frac{2}{b (a+b)^2 x^4}-\frac{2 (a-b)}{b (a+b)^3 x^2}+\frac{3 a-2 b}{(a+b)^3 \left (a+b+b x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac{(a-b) \cot (e+f x)}{(a+b)^3 f}-\frac{\cot ^3(e+f x)}{3 (a+b)^2 f}-\frac{a b \tan (e+f x)}{2 (a+b)^3 f \left (a+b+b \tan ^2(e+f x)\right )}-\frac{((3 a-2 b) b) \operatorname{Subst}\left (\int \frac{1}{a+b+b x^2} \, dx,x,\tan (e+f x)\right )}{2 (a+b)^3 f}\\ &=-\frac{(3 a-2 b) \sqrt{b} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a+b}}\right )}{2 (a+b)^{7/2} f}-\frac{(a-b) \cot (e+f x)}{(a+b)^3 f}-\frac{\cot ^3(e+f x)}{3 (a+b)^2 f}-\frac{a b \tan (e+f x)}{2 (a+b)^3 f \left (a+b+b \tan ^2(e+f x)\right )}\\ \end{align*}
Mathematica [C] time = 6.76797, size = 637, normalized size = 5.18 \[ \frac{\sec ^4(e+f x) \left (a b \sin (2 e)-a b \sin (2 f x)+2 b^2 \sin (2 e)\right ) (a \cos (2 e+2 f x)+a+2 b)}{8 f (a+b)^3 (\cos (e)-\sin (e)) (\sin (e)+\cos (e)) \left (a+b \sec ^2(e+f x)\right )^2}-\frac{\cot (e) \csc ^2(e+f x) \sec ^4(e+f x) (a \cos (2 e+2 f x)+a+2 b)^2}{12 f (a+b)^2 \left (a+b \sec ^2(e+f x)\right )^2}+\frac{\csc (e) \sin (f x) \csc ^3(e+f x) \sec ^4(e+f x) (a \cos (2 e+2 f x)+a+2 b)^2}{12 f (a+b)^2 \left (a+b \sec ^2(e+f x)\right )^2}+\frac{\csc (e) \csc (e+f x) \sec ^4(e+f x) (a \sin (f x)-2 b \sin (f x)) (a \cos (2 e+2 f x)+a+2 b)^2}{6 f (a+b)^3 \left (a+b \sec ^2(e+f x)\right )^2}+\frac{(3 a-2 b) \sec ^4(e+f x) (a \cos (2 e+2 f x)+a+2 b)^2 \left (\frac{b \cos (2 e) \tan ^{-1}\left (\sec (f x) \left (\frac{\cos (2 e)}{2 \sqrt{a+b} \sqrt{b \cos (4 e)-i b \sin (4 e)}}-\frac{i \sin (2 e)}{2 \sqrt{a+b} \sqrt{b \cos (4 e)-i b \sin (4 e)}}\right ) (a \sin (2 e+f x)-a \sin (f x)-2 b \sin (f x))\right )}{8 f \sqrt{a+b} \sqrt{b \cos (4 e)-i b \sin (4 e)}}-\frac{i b \sin (2 e) \tan ^{-1}\left (\sec (f x) \left (\frac{\cos (2 e)}{2 \sqrt{a+b} \sqrt{b \cos (4 e)-i b \sin (4 e)}}-\frac{i \sin (2 e)}{2 \sqrt{a+b} \sqrt{b \cos (4 e)-i b \sin (4 e)}}\right ) (a \sin (2 e+f x)-a \sin (f x)-2 b \sin (f x))\right )}{8 f \sqrt{a+b} \sqrt{b \cos (4 e)-i b \sin (4 e)}}\right )}{(a+b)^3 \left (a+b \sec ^2(e+f x)\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.106, size = 160, normalized size = 1.3 \begin{align*} -{\frac{1}{3\,f \left ( a+b \right ) ^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{3}}}-{\frac{a}{f \left ( a+b \right ) ^{3}\tan \left ( fx+e \right ) }}+{\frac{b}{f \left ( a+b \right ) ^{3}\tan \left ( fx+e \right ) }}-{\frac{ab\tan \left ( fx+e \right ) }{2\,f \left ( a+b \right ) ^{3} \left ( a+b+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{3\,ab}{2\,f \left ( a+b \right ) ^{3}}\arctan \left ({\tan \left ( fx+e \right ) b{\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) b}}}}+{\frac{{b}^{2}}{f \left ( a+b \right ) ^{3}}\arctan \left ({\tan \left ( fx+e \right ) b{\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) b}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.688201, size = 1534, normalized size = 12.47 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28925, size = 259, normalized size = 2.11 \begin{align*} -\frac{\frac{3 \, a b \tan \left (f x + e\right )}{{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )}{\left (b \tan \left (f x + e\right )^{2} + a + b\right )}} + \frac{3 \,{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (b\right ) + \arctan \left (\frac{b \tan \left (f x + e\right )}{\sqrt{a b + b^{2}}}\right )\right )}{\left (3 \, a b - 2 \, b^{2}\right )}}{{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \sqrt{a b + b^{2}}} + \frac{2 \,{\left (3 \, a \tan \left (f x + e\right )^{2} - 3 \, b \tan \left (f x + e\right )^{2} + a + b\right )}}{{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )^{3}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]